Skip to content

Add Spec for IsWindowControlsOverlayEnabled.md - #4613

Open
Tochukwu Ibe-Ekeocha (tochukwuIbeEkeocha) wants to merge 23 commits into
mainfrom
api-isWindowControlsOverlayEnabled-draft
Open

Add Spec for IsWindowControlsOverlayEnabled.md#4613
Tochukwu Ibe-Ekeocha (tochukwuIbeEkeocha) wants to merge 23 commits into
mainfrom
api-isWindowControlsOverlayEnabled-draft

Conversation

@tochukwuIbeEkeocha

@tochukwuIbeEkeocha Tochukwu Ibe-Ekeocha (tochukwuIbeEkeocha) commented Jun 4, 2024

Copy link
Copy Markdown
Contributor

What

These new APIs introduce support for a Webview2 Window Controls Overlay. The Window Controls Overlay will allow developers to build apps in webview2 with 100% of the UI controlled by the browser process. Devs will be able to create their apps as borderless & caption-less windows, and have the Webview draw its own window control buttons (minimize,maximize, close, restore).

image image

Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
Comment thread specs/IsWindowControlsOverlayEnabled.md Outdated
@tochukwuIbeEkeocha
Tochukwu Ibe-Ekeocha (tochukwuIbeEkeocha) force-pushed the api-isWindowControlsOverlayEnabled-draft branch 7 times, most recently from 3866c89 to bce67e9 Compare August 28, 2024 21:54
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
@ahqsoftwares

Copy link
Copy Markdown

Is there any ETA on when this update might come to webview2?

Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Co-authored-by: David Risney <dave@deletethis.net>
Co-authored-by: David Risney <dave@deletethis.net>
Co-authored-by: Viktoria Zlatinova <vizlatin@microsoft.com>
Co-authored-by: Viktoria Zlatinova <vizlatin@microsoft.com>
Co-authored-by: Viktoria Zlatinova <vizlatin@microsoft.com>
Co-authored-by: David Risney <dave@deletethis.net>
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated

CoreWebView2WindowControlsOverlaySettings config = Webview2.CoreWebivew2.WindowControlsOverlaySettings;
config.IsEnabled = true;
config.color = Color.FromARGB(0, 0, 255);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the order of setting these properties matter? If I set enabled=true before setting .color might there be a frame rendered of the overlay with the default color?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update docs to say when does the IsEnabled change take affect - immediate or batched once the UI thread has a chance to work.

Prefer: the order shouldn't matter. If order matters we'll follow up.

Comment thread specs/WindowControlsOverlayConfiguration.md
///
/// When using this you should configure your app window to not display its default
/// window control buttons. You are responsible for creating a title bar for your app
/// by using the available space to the left of the controls overlay. In doing so,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this right or left conditional on the reading direction of the UI root?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document what happens for RTL locales - does the controls overlay render on the left instead of right?

In the text here say 'before' instead of 'left'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In RTL locales, the caption buttons still appear on the right side of the window, just like in LTR. The ordering of the buttons themselves is mirrored (Close | Maximize | Minimize), but their position remains on the right side of the window.

keeping that in mind 'left' actually fits correctly in the statement? please let me know if you still want it to be 'before' ?


/// The `TitleBarBackgroundColor` property allows you to set a background color
/// for the overlay. Based on the background color you choose, Webview2
///will automatically calculate a foreground and hover color that will

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is foreground color necessarily black or white? We might be leaving this undocumented to reserve the right to choose colors based on the hosting app?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They won't be white/black it will be based on the background color.
It would be helpful to include some screenshots of examples.

Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update per comments, thanks!

Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md Outdated

CoreWebView2WindowControlsOverlaySettings config = Webview2.CoreWebivew2.WindowControlsOverlaySettings;
config.IsEnabled = true;
config.color = Color.FromARGB(0, 0, 255);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update docs to say when does the IsEnabled change take affect - immediate or batched once the UI thread has a chance to work.

Prefer: the order shouldn't matter. If order matters we'll follow up.

[propget] HRESULT Height([out, retval] UINT32* value);


/// The `Height` property in raw screen pixels, allows you to set the height of the overlay and

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Brad Peters (@bradp0721) Does it make sense to use raw screen pixels here vs view pixels?

Also, we should ensure that different DPI awareness doesn't create bugs with real raw pixels vs virtual DPI scaled raw pixels.

/// for the overlay. Based on the background color you choose, Webview2
///will automatically calculate a foreground and hover color that will
/// provide you the best contrast while maintaining accessibility.
/// Defaults to #f3f3f3. This API supports transparency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Document that it does not support changing the default color or default height for OS theming (dark/light mode and high contrast) and height.


/// The `TitleBarBackgroundColor` property allows you to set a background color
/// for the overlay. Based on the background color you choose, Webview2
///will automatically calculate a foreground and hover color that will

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They won't be white/black it will be based on the background color.
It would be helpful to include some screenshots of examples.

Comment thread specs/WindowControlsOverlayConfiguration.md Outdated
Comment thread specs/WindowControlsOverlayConfiguration.md

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Proposal Review WebView2 API Proposal for review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants